//
//  LMSNewIntroduceTableViewCell.m
//  LMS
//
//  Created by dfws on 2019/3/19.
//  Copyright © 2019年 dfws. All rights reserved.
//

#import "LMSNewIntroduceTableViewCell.h"
#import "DemoHelp.h"
@implementation LMSNewIntroduceTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configUI];
    }
    return self;
}
- (void)configUI{
    [self.bottomView addSubview:self.infoLb];
    
    
}
- (void)configureCellWithStr:(NSString *)contentstr
{
    //    test
    _infoLb.text = contentstr;
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.02 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        if (self.refreshBlock) {
            self.refreshBlock();
        }
    });
    
}
- (CGFloat)realHeight{
    UIView *superView = [UIView new];
    [super addSubview:self.contentView];
    [self.contentView mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(UIEdgeInsetsZero);
    }];
    [self addSubview:superView];
    CGFloat heitght = [DemoHelp getViewHeight:superView]+50;
    
    return heitght;
}
- (void)layoutSubviews{
    [super layoutSubviews];
    CGFloat gap = 15;

    [_infoLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(@(gap));
        make.left.equalTo(@(gap));
        make.right.equalTo(self.bottomView).offset(-gap);
        make.bottom.mas_equalTo(self.bottomView).offset(-gap);
    }];
    
}

- (UILabel *)infoLb{
    if (!_infoLb) {
        _infoLb = [DemoHelp getLbByFont:14];
        [DemoHelp setLbHuggingAndCompress:_infoLb];
        _infoLb.numberOfLines = 0;
    }
    return _infoLb;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
